import axios from '@/request/seep.js';
export function fetchGoodsList(options) {
 
    let {
        page,
        pagesize
    } =options
    return axios.get(`/getgoods?pageindex=${page}&pagesize=${pagesize}`)
}
export function fetchNewsList(page = 1, limit = 10) {
    return axios.get(`/getnewslist?page=${page}&pagesize=${limit}`)
}
export function fetchNewsDetails(id) {
    return axios.get(`/getnew/${id}`)
}
export function fetchNewsDissus(id,page) {
    return axios.get(`/getcomments/${id}?pageindex=${page}`)
}
export function fetchpushDissus(id,content) {
    return axios.post(`postcomment/${id}`,content)
}
export function fetchgoodslunbo(id) {
    return axios.get(`getthumbimages/${id}`)
}
export function fetchgoodsdetail(id) {
    return axios.get(`getgoodsinfo/${id}`)
}
export function fetchlogin(message) {
    return axios.post(`/login`,message)
}
export function fetchregister(message) {
    return axios.post(`/register`,message)
}
export function fetchSearch(options) {
    console.log("搜索",options);
    let {
        keyword,
        sort,
        order,
        page,
        pagesize
    } = options;
    return axios.get(`/search?value=${keyword}&sort=${sort}&order=${order}&page=${page}&pagesize=${pagesize}`)
}
export function fetchshopcarlist(message) {
    return axios.get(`/getshopcarlist/${message}`)
}
export function fetchaddaddress(id,useinfo) {
    return axios.post(`/addaddress/${id}`,useinfo)
}
export function fetchaddress(id) {
    return axios.get(`/getaddress/${id}`)
}
export function fetcheditaddress(id,data) {
    return axios.post(`/updateaddress/${id}`,data)
}

export function fetchdeleteddress(id) {
    return axios.post(`/deladdress/${id}`)
}